package com.tiles.controller;

import com.tiles.entity.TbProfession;
import com.tiles.entity.TilesUser;
import com.tiles.service.ProfessionService;
import com.tiles.service.StudentService;
import com.tiles.service.TilesUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/u")
public class ProfessionController {

    @Autowired
    private ProfessionService service;
    //    用户管理列表，用于验证redis服务器
    @GetMapping("/plist")
    public String userlist(Model model, HttpServletRequest request){
        List<TbProfession> professionList = service.ProfessionAll();

        model.addAttribute(professionList);
        request.setAttribute("tilesUserList",professionList);
        return "plist";

    }

}
